<?php

foreach($result AS $r)
  {
    $search = ":";
    $replace = "";
    $mac = str_replace($search,$replace,$r['m']['mac']);
    $line = array($mac);
    $csv->addRow($line);
  }

$datum = date("d.m.Y");
$end = ".csv";
$title = "Export_MAC_Runid-".$runid."_".$datum.".csv";
echo $csv->render($title);


?>